package com.spring.cloud.controller;

import com.spring.cloud.service.FeignService;
import com.spring.cloud.service.RibbonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/3/31.
 */
@RestController
public class ConsumerController {

    private static Logger logger = LoggerFactory.getLogger(ConsumerController.class);

    @Autowired
    RibbonService ribbonService;

    @Autowired
    FeignService feignService;

    @RequestMapping(value = "/call")
    public String call() {
        String name = "robot";
        logger.info(ribbonService.say());
        logger.info(feignService.say());
        logger.info(feignService.sweep(name));
        return "successfully";
    }

}
